package com.appbee.core.client.rpcfilter.callback;


import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.requestfactory.shared.ServerFailure;

public class FilterAsynchCallback<T> implements AsyncCallback<T>
{
	private FilterCallback<T> callback;

	public FilterAsynchCallback(FilterCallback<T> callback)
	{
		this.callback = callback;
	}

	@Override
	public void onFailure(Throwable caught)
	{
		callback.onFailure(new ServerFailure(caught.getMessage()));
	}

	@Override
	public void onSuccess(T result)
	{
		callback.onSuccess(result);
	}

}
